from heapq import heappush, heappop

class MyHeap:
	"A class"
    def __init__(self):
        self.A = []
		#update(self, A=[], order=order, f=f)
    def append(self, item):
		heappush(self.A, item)
        #bisect.insort(self.A, (self.f(item), item))

	def __len__(self):
        return len(self.A)

    def pop(self):
		return heappop(self.A)
	
	def extend(self, l):
		for i in l:
			heappush(self.A, i)

